// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using SqlSugar;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application.Entity;

/// <summary>
/// 库存表
/// </summary>
[Tenant("1300000000001")]
[SugarTable("inventory", "库存表")]
public partial class InventoryModel : EntityBaseDel
{
    /// <summary>
    /// 货品ID
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "GoodsId", ColumnDescription = "货品ID")]
    public virtual long GoodsId { get; set; }

    /// <summary>
    /// 仓库ID
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "WarehouseId", ColumnDescription = "仓库ID")]
    public virtual long WarehouseId { get; set; }

    /// <summary>
    /// 库位ID
    /// </summary>
    [SugarColumn(ColumnName = "WarePlaceId", ColumnDescription = "库位ID")]
    public virtual long? WarePlaceId { get; set; }

    /// <summary>
    /// 库存数量
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "StockQuantity", ColumnDescription = "库存数量")]
    public virtual int StockQuantity { get; set; }

    /// <summary>
    /// 锁定数量
    /// </summary>
    [SugarColumn(ColumnName = "LockedQuantity", ColumnDescription = "锁定数量")]
    public virtual int LockedQuantity { get; set; }

    /// <summary>
    /// 可用数量
    /// </summary>
    [SugarColumn(ColumnName = "AvailableQuantity", ColumnDescription = "可用数量")]
    public virtual int AvailableQuantity { get; set; }

    /// <summary>
    /// 待入库数量
    /// </summary>
    [SugarColumn(ColumnName = "PendingInbound", ColumnDescription = "待入库数量")]
    public virtual int PendingInbound { get; set; }

    /// <summary>
    /// 待出库数量
    /// </summary>
    [SugarColumn(ColumnName = "PendingOutbound", ColumnDescription = "待出库数量")]
    public virtual int PendingOutbound { get; set; }

    /// <summary>
    /// 期初库存
    /// </summary>
    [SugarColumn(ColumnName = "BeginningStock", ColumnDescription = "期初库存")]
    public virtual int BeginningStock { get; set; }

    /// <summary>
    /// 期末库存
    /// </summary>
    [SugarColumn(ColumnName = "EndingStock", ColumnDescription = "期末库存")]
    public virtual int EndingStock { get; set; }

    /// <summary>
    /// 库存单价
    /// </summary>
    [SugarColumn(ColumnName = "StockPrice", ColumnDescription = "库存单价")]
    public virtual decimal StockPrice { get; set; }

    /// <summary>
    /// 库存金额
    /// </summary>
    [SugarColumn(ColumnName = "StockAmount", ColumnDescription = "库存金额")]
    public virtual decimal StockAmount { get; set; }

    /// <summary>
    /// 最后入库时间
    /// </summary>
    [SugarColumn(ColumnName = "LastInboundTime", ColumnDescription = "最后入库时间")]
    public virtual DateTime? LastInboundTime { get; set; }

    /// <summary>
    /// 最后出库时间
    /// </summary>
    [SugarColumn(ColumnName = "LastOutboundTime", ColumnDescription = "最后出库时间")]
    public virtual DateTime? LastOutboundTime { get; set; }

    /// <summary>
    /// 库存状态
    /// </summary>
    [SugarColumn(ColumnName = "StockStatus", ColumnDescription = "库存状态")]
    public virtual bool StockStatus { get; set; } = true;

    /// <summary>
    /// 库存备注
    /// </summary>
    [SugarColumn(ColumnName = "StockNote", ColumnDescription = "库存备注", Length = 512)]
    public virtual string? StockNote { get; set; }
}
